home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_13_09
/
barbu2
/
memblock.hpp
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-27
|
934b
|
34 lines
////////////////////////////////////////////////////////////////////////////
// MEMBLOCK, an extensible memory block
////////////////////////////////////////////////////////////////////////////
#if !defined(MEMBLOCK_HPP)
#define MEMBLOCK_HPP
#if !defined(RC_INVOKED) // no Windows RC compiler, real C++ stuff below
class MEMBLOCK {
public:
MEMBLOCK();
~MEMBLOCK();
short add(const unsigned char Slot[], unsigned long SlotLength);
//returns 1 if ok
unsigned long len() const { return _len; }
const unsigned char huge* get() const { return _buf; }
unsigned long maxAdd() const { return _maxAdd; }
protected:
unsigned long space() const;
short addSpace(unsigned long ExtraLength);
//returns 1 if ok
private:
MEMBLOCK(const MEMBLOCK&);
MEMBLOCK& operator=(const MEMBLOCK&);
unsigned char huge * _buf;
unsigned long _space;
unsigned long _len;
unsigned long _maxAdd;
};
#endif
#endif